package com.sojson.project.pay.service;

import java.util.List;

import com.sojson.base.impl.BaseOrder;
import com.sojson.enums.core.EPayType;
import com.sojson.project.entity.bo.PayResponse;
import com.sojson.project.entity.po.Order;
import com.sojson.project.entity.po.OrderDeposit;
import com.sojson.project.entity.po.TransferRecord;
import com.sojson.project.entity.vo.HotelOrderVo;

/**
 * 支付Service
 * 
 * @author liu
 * @date 2021-03-24
 */
public interface PayService {

    /**
     * 商城购物车调起支付
     * 
     * @param nos
     * @return
     * @throws Exception 
     */
    PayResponse goodsShop(String[] nos) throws Exception;

    /**
     * 获取商城订单
     * 
     * @param orderNo
     * @return
     */
    Order getOrderGoods(String orderNo);

    /**
     * 获取购物车订单
     * 
     * @param noShop
     * @return
     */
    List<Order> getOrderGoodsShop(String noShop);

    /**
     * 商城支付回调
     * 
     * @param order
     * @param payNo     支付单号
     * @param payType   支付类型
     * @return
     * @throws Exception 
     */
    boolean goods(Order order, String payNo, EPayType payType) throws Exception;

    /**
     * 购物车支付回调
     * 
     * @param orders
     * @param payNo     支付单号
     * @param payType   支付类型
     * @return
     */
    boolean goodsShop(List<Order> orders, String payNo, EPayType payType);

    /**
     * 商城退款回调
     * 
     * @param orderNo   订单号
     * @param refundNo  退款单号
     * @param payType   支付类型
     * @return
     * @throws Exception 
     */
    boolean goodsCancel(String orderNo, String refundNo, EPayType payType) throws Exception;

    /**
     * 诚意金调起支付
     * 
     * @param orderId
     * @return
     * @throws Exception 
     */
    BaseOrder deposit(String orderId) throws Exception;

    /**
     * 获取诚意金订单
     * 
     * @param orderNo
     * @return
     */
    OrderDeposit getOrderDeposit(String orderNo);

    /**
     * 诚意金支付回调
     * 
     * @param order
     * @param payNo     支付单号
     * @param payType   支付类型
     * @return
     */
    boolean deposit(OrderDeposit order, String payNo, EPayType payType);

    /**
     * 诚意金退款回调
     * 
     * @param orderNo   订单号
     * @param refundNo  退款单号
     * @param payType   支付类型
     * @return
     * @throws Exception 
     */
    boolean depositCancel(String orderNo, String refundNo, EPayType payType) throws Exception;

    /**
     * 酒店调起支付
     * 
     * @param nos
     * @return
     * @throws Exception 
     */
    PayResponse hotel(String[] nos) throws Exception;

    /**
     * 获取酒店订单
     * 
     * @param orderNo
     * @return
     */
    HotelOrderVo getOrderHotel(String orderNo);

    /**
     * 酒店订单支付回调
     * 
     * @param order
     * @param payNo     支付单号
     * @param payType   支付类型
     * @return
     * @throws Exception 
     */
    boolean hotel(HotelOrderVo order, String payNo, EPayType payType) throws Exception;

    /**
     * 酒店订单退款回调
     * 
     * @param orderNo   订单号
     * @param refundNo  退款单号
     * @param payType   支付类型
     * @return
     * @throws Exception 
     */
    boolean hotelCancel(String orderNo, String refundNo, EPayType payType) throws Exception;

    /**
     * 提现
     * 
     * @param transferRecord
     * @return
     * @throws Exception
     */
    int withdrawDeposit(TransferRecord transferRecord) throws Exception;

    /**
     * 提现申请
     * 
     * @param transferRecord
     * @return
     * @throws Exception
     */
    int withdrawDepositApplyFor(TransferRecord transferRecord) throws Exception;

    /**
     * 提现审核
     * 
     * @param transferRecord
     * @return
     * @throws Exception
     */
    int withdrawDepositAudit(TransferRecord transferRecord) throws Exception;

    /**
     * 提现成功
     * 
     * @param transferRecord
     * @param noPay             支付单号
     * @return
     * @throws Exception
     */
    int withdrawDepositSuccess(TransferRecord transferRecord, String noPay) throws Exception;

    /**
     * 提现中
     * 
     * @param transferRecord
     * @param noPay             支付单号
     * @return
     * @throws Exception
     */
    int withdrawDepositIng(TransferRecord transferRecord, String noPay) throws Exception;

    /**
     * 提现失败
     * 
     * @param transferRecord
     * @param msg               失败信息
     * @return
     * @throws Exception
     */
    int withdrawDepositFail(TransferRecord transferRecord, String msg) throws Exception;

    /**
     * 重新提现
     * 
     * @param orderNo   订单号
     * @return
     * @throws Exception
     */
    int anewWithdrawDeposit(String orderNo) throws Exception;

}